using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using NCS.Module.Multimedia.Library.Bonus;
using NCS.Module.Multimedia.Library;
using NCS.Library.Utilities;

namespace NCS.Module.Multimedia.Web.Bonus
{
    public partial class FolderBonus : GalleryWebControl
    {
        private string userUploadPath = Library.Definies.UploadPath;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                dtgPicList.DataSource = Gallery_CateBonusController.GetAllCateBonus();
                dtgPicList.ItemDataBound += new DataListItemEventHandler(dtgPicList_ItemDataBound);
                dtgPicList.DataBind();
            }
        }
        void dtgPicList_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if (e.Item.ItemIndex < 0) return;
            DataRowView currow = (DataRowView)e.Item.DataItem;
            HyperLink hplbonus = (HyperLink)e.Item.FindControl("linkFolder");
            hplbonus.NavigateUrl = BuildUrlByCateBonusInAlbum(ConvertUtility.ToInt32(currow["CateBonusID"]));
        }
    }
}